package org.yxt.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * 所有的bean配置
 */
@Configuration
public class ApplicationContextConfig {

    /**
     * @LoadBalanced 将访问的应用名称在eureka列表中寻找对应的访问地址信息进行访问
     * @return
     */
    @Bean
    @LoadBalanced
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
}
